# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=gosint
pkgver=196.9c86ed2
pkgrel=3
pkgdesc='OSINT framework in Go.'
groups=('blackarch' 'blackarch-recon')
arch=('x86_64' 'aarch64')
url='https://github.com/Nhoya/gOSINT'
license=('GPL3')
depends=('tesseract')
makedepends=('git' 'go')
source=("$pkgname::git+https://github.com/Nhoya/gOSINT.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  # Package uses a old dependency declaration format and can't be build with the
  # new process. Details of the issue: https://golang.org/doc/go1.4#internalpackages
  # Upstream report: https://github.com/Nhoya/gOSINT/issues/34
  GOPATH="$srcdir/$pkgname" go get github.com/Nhoya/gOSINT/cmd/gosint
}

package() {
  cd "$pkgname"

  install -Dm 755 "bin/$pkgname" "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
}

